<!DOCTYPE html>
<html>
<head>
    <title>修改密码</title>
    <link rel="stylesheet" href="/resources/layuimini/lib/layui-v2.6.3/css/layui.css" media="all">
</head>
<body>
<form class="layui-form" id="changePwdFrm">
    <div class="layui-form-item" style="text-align: center">
        <label class="layui-form-label">旧的密码</label>
        <div class="layui-input-block">
            <input type="password" name="oldPassword" lay-verify="required" placeholder="请输入旧的密码" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" style="text-align: center">
        <label class="layui-form-label">新的密码</label>
        <div class="layui-input-block">
            <input type="password" name="password" lay-verify="required" placeholder="请输入新的密码" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" style="text-align: center">
        <label class="layui-form-label">新的密码</label>
        <div class="layui-input-block">
            <input type="password" name="password2" lay-verify="required" placeholder="请输入新的密码" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" style="text-align: center">
        <input type="button" value="确认保存" class="layui-btn layui-btn-normal" lay-submit id="changePwd" lay-filter="changePwd">
    </div>
</form>
</body>
<script src="/resources/layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['jquery','form'],function (){
        let $ = layui.jquery;
        let form = layui.form;
        form.on("submit(changePwd)",function (obj){
            let data = obj.field;
            $.post("/user/changePwd.do",data,function (res){
                layer.msg(res.msg);
                if (res.code==200) {
                    layer.alert(res.msg,function (){
                        location.href="index.jsp";
                    })
                }
            })
        })
    })
</script>
</html>


